<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<html class="zh-cn zh cn" lang="zh-cn"> 
<head>
	<%@ include file="../head.jsp" %>
	
	<!-- 1. Add these JavaScript inclusions in the head of your page -->
	<script type="text/javascript" src="/resource/style/xpdd/act/lib/highcharts.js"></script>
	<script type="text/javascript" src="/resource/style/xpdd/act/lib/exporting.js"></script>
	<script src="/resource/js/actjson.js"></script>
	<!-- 2. Add the JavaScript to initialize the chart on document ready -->
	<script type="text/javascript">
	
	function getAnalysisGlobalData()
	{
		var chart;
		jQuery.ajax( {
			contentType : 'application/json',
			type : "GET",
			url : "/analysis/globalData",
			dataType : 'json',
			success : function(result) {
				if(parseInt(result.code < 0))
				{
					return false;
				}
				
				var data = jQuery.evalJSON(result.json);
				
				chart = new Highcharts.Chart({
					chart: {
						renderTo: 'container', 
						defaultSeriesType: 'area'
					},
					title: {
						text: '本月各活动状况'
					},
					subtitle: {
						text: '已成交宝贝数量以及时间'
					},
					xAxis: {
						labels: {
							formatter: function() {
								return this.value; // clean, unformatted number for year
							}
						}							
					},
					yAxis: {
						title: {
							text: '活动参与人次'
						},
						labels: {
							formatter: function() {
								return this.value +'人次';
							}
						}
					},
					tooltip: {
						formatter: function() {
							return this.series.name +' 砍价 <b>'+
								Highcharts.numberFormat(this.y, 0) +'</b>件<br/>于 '+ this.x + '日';
						}
					},
					plotOptions: {
						area: {
							pointStart: 1,
							marker: {
								enabled: false,
								symbol: 'circle',
								radius: 2,
								states: {
									hover: {
										enabled: true
									}
								}
							}
						}
					},
					series: data
				});
			},  
	        error : function() {
				return false;
	          }
		});
	}
	
	
	jQuery(document).ready(function() {
		
		//设置当前路径
		jQuery("#breadcrumb").append('<li><span>:&nbsp;&nbsp;全局分析</span></li>');
		
		getAnalysisGlobalData();
	});
	</script>
	<style type="text/css"> 
		.home #family-iphone .product .new-icon { top: 22px; left: 2px;} 
	</style> 
</head>

<body class="vday home">
	<div id="page">
	<%@ include file="../global_navi.jsp" %>
	<%@ include file="../aos_header.jsp" %><!-- 如果需要查询，要自定义aos_header -->
 	<%@ include file="../guide.jsp" %><!-- 动态向导栏，需要后台 --> 
		<div id="primary">
			<div id="primary_main" role="main">
				<div class="box product-shelf">
					<div class="box-content clearfix">
						<c:set value="actSize" var="tmpKey"></c:set>
						&nbsp;&nbsp;<strong>本月活动总数</strong>：${actCount }  －  
						&nbsp;&nbsp;<strong>活动参与总人次</strong>：${inCount }
						<!-- 3. Add the container -->
						<div id="container" style="width: 600px; height: 300px; margin: 0 auto"></div>
					</div>
					<div class="top-corners"></div>
					<div class="bottom-corners"></div>
				</div>
				<ul class="home-page-banners clearfix"></ul>
				<div class="box featured-accessories">
					<div class="title-bar">
						<h2>活动记录</h2>
					</div>
					<div class="box-content clearfix">
						<div class="product-grid">
							<ul class="product-row clearfix first-row">
								<li class="superlink product first-tile"> 
								<dl>
									<dt class="price" title="nick_22">活动</dt>
								</dl>
								</li>
								<li class="superlink product first-tile">
								<dl>
									<dt class="price" title="nick_22">开始时间</dt>
								</dl>
								</li>
								<li class="superlink product first-tile">
								<dl>
									<dt class="price" title="nick_22">结束时间</dt>
								</dl>
								</li>
								<li class="superlink product last-tile">
								<dl>
									<dt class="price" title="nick_22">参与人次</dt>
								</dl>
								</li>
							</ul>

							<c:forEach items="${actList }" var="act">
								<ul class="product-row clearfix last-row">
									<li class="superlink product first-tile">
									<dl>
										<dt class="name" title="活动名称">
											<a href="/analysis/activity_${act.aid }">${act.aname }</a>
										</dt>
									</dl>
									</li>
									<li class="superlink product first-tile">
									<dl>
										<dd class="name" title="开始时间">
											<fmt:formatDate value="${act.beginTime }" pattern="yyyy-MM-dd"/>
										</dd>
									</dl>
									</li>
									<li class="superlink product first-tile">
									<dl>
										<dt class="name" title="结束时间">
											<fmt:formatDate value="${act.endTime}" pattern="yyyy-MM-dd"/>
										</dt>
									</dl>
									</li>
									<li class="superlink product last-tile">
									<dl>
										<dt class="name" title="参与人次">
											${act.userSize }人次
										</dt>
									</dl>
									</li>
								</ul>
							</c:forEach>
						</div>
					</div>
					<div class="bottom-corners"></div>
				</div>
			</div>
			<div id="secondary" class="rail">
				<div role="navigation" aria-label="New Items" class="box navigation-list new-to-store">
					<div class="title-bar">
						<h2> 操作</h2>
					</div>
					<div class="box-content clearfix">
						<div class="list_content">
							<ul>
								<li><a href="../" onclick="" >返回活动首页</a></li>
							</ul>
						</div>
					</div>
					<div class="bottom-corners"></div>
				</div>
				<div class="box navigation-list top-sellers"></div>
				<div class="module footerblock"></div>
			</div>
		</div>
	<%@ include file="../left_navi.jsp" %>
	<%@ include file="../footer.jsp" %>
	</div>
</body> 
</html> 
 <!-- 
 [{
						name: '5.1 血拼活动',
						data: [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 22, 24, 
							22, 26, 20, 18, 19, 20, 22, 33, 34, 35, 
							null, null, null, null, null, null, null, null ]
					}, {
						name: '夏季血拼活动',
						data: [30, 29, 28, 27, 24, 25, 26, 27, 28, 29, 32, 34, 
							22, 26, 20, 18, 19, 16, 17, 18, 19, 15, 
							null, null, null, null, null, null, null, null ]
					}, {
						name: '我爱血拼活动',
						data: [5, 6, 5, 6, 7, 5, 6, 7, 8, 10, 15, 20, 
							25, 30, 35, 40, 38, 36, 34, 32, 30, 28, 
							null, null, null, null, null, null, null, null ]
					}
					, {
						name: '欢乐血拼',
						data: [5, 10, 15, 20, 27, 28, 29, 30, 32, 36, 38, 40, 
							42, 45, 49, 40, 38, 36, 34, 32, 30, 28, 
							null, null, null, null, null, null, null, null ]
					}
					]
  -->